import VueRouter from 'vue-router'

import HomeContainer from './component/tabar/HomeContainer.vue'
import MemContainer from './component/tabar/Mencontainer.vue'
import SearchContainer from './component/tabar/SearchContainer.vue'
import ShopcarContainer from './component/tabar/ShopCarContainer.vue'
import NewsList from './component/news/NewsList.vue'
import NewsInfo from './component/news/NewsInfo.vue'
import PhotoList from './component/photos/PhotoList.vue'
import PhotoInfo from './component/photos/photoinfo.vue'
import GoodsList from './component/goods/GoodsList.vue'
import GoodsInfo from './component/goods/GoodsInfo.vue'
import GoodsDesc from './component/goods/GoodsDesc.vue'
import GoodsComment from './component/goods/GoodsComment.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [{
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: HomeContainer
    },
    {
      path: '/menber',
      component: MemContainer
    },
    {
      path: '/shopcar',
      component: ShopcarContainer
    },
    {
      path: '/search',
      component: SearchContainer
    },
    {
      path: '/home/newlist',
      component: NewsList
    },
    {
      path: '/home/newsinfo/:id',
      component: NewsInfo
    },
    {
      path: '/home/photolist',
      component: PhotoList
    },
    {
      path: '/home/photoinfo/:id',
      component: PhotoInfo
    },
    {
      path: '/home/goodslist',
      component: GoodsList
    },
    {
      path: '/home/goodsinfo/:id',
      component: GoodsInfo
    },
    {
      path: '/home/goodsdesc/:id',
      component: GoodsDesc,
      name: 'goodsdesc'
    },
    {
      path: '/home/goodscomment/:id',
      component: GoodsComment,
      name: 'goodscomment'
    },
  ],
  linkActiveClass: ' mui-active'
})

// 把路由对象暴露出去
export default router